from rest_framework import serializers
#from rest_framework import response
from book  import models as  models_book
import base64
from utils import utils
from django.db.models import Q
import os
#from tiku.api import serializers as serializers_tiku
#import rest_framework as drf

class BookSerializer(serializers.ModelSerializer):
    class Meta:
        model=models_book.Book
        fields = ('name','university','author','version',)


class BookBaseSerializer(serializers.ModelSerializer):
    class Meta:
        model=models_book.Book
        fields = "__all__"


class TiBaseSerializer(serializers.ModelSerializer):
    class Meta:
        model=models_book.Ti
        fields = "__all__"

class XiaoTiSerializer(serializers.ModelSerializer):
    class Meta:
        model = models_book.Ti
        fields = ('id','xiaoti_number','question','answer', 'qa')